home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / patches / rs232-2 / softrs2.txt < prev    next >
Text File  |  1989-05-12  |  9KB  |  190 lines

  1. Oulu, Finland 1.1.-89                Kari Alakuijala (C) (Copyright)
  2.  
  3. Chapter II   -SOFTWARE SUPPORT
  4.  
  5.  
  6.       This port is supported by ST. To the programmer it is similar to MIDI,
  7.       but much slower in sending greater amounts of data.
  8.         In ST-basic this port can be read from port inp(3) and status from
  9.       inp(-3). The original RS-232 is inp(1), when the keyboard is inp(2).
  10.         Use the VT-52 terminal programme "MIDITERM.TOS" to test drive the
  11.       2nd RS-232 interface. Miditerm.c shows some programming 'examples' to
  12.       use with language C.
  13.         The sending and receiving from this port is similar to sending and
  14.       receiving MIDI or RS -data. Also the transmit/receive buffers are
  15.       provided by the bios. Even the speed control is provided by bios. The
  16.       only thing that is missing is the (DCD/)DTR -control and the word lenght
  17.       & parity control over the interface. These can be achieved by poking the
  18.       values directly into registers on ACIA 6850. Enter the supervisor -mode
  19.       (see your language manual on this) and alter the settings on the MIDI
  20.       ACIA - CONTROL REGISTER found on $FFFC04 (this register is 8-bit). If
  21.       you want to alter 2nd RS -speed, do it with multi function peripheral
  22.       MFP68901 and the till now unused timer A of it.
  23.  
  24.  
  25.  
  26.       2nd RS speed is changed by timer A of MFP68901. See your language manual
  27.       on how to do it. For example (using language C):
  28.  
  29.         Xbtimer (0, 1, n, -1);
  30.  
  31.         where:
  32.         -Number 0 stands for timer A of four timers selected.
  33.         -Number 1 stands for a control register value of 1.
  34.         -N is frequency divider. 2nd RS-232 speed is 2.4576 MHz/(2*4*n*16).
  35.         -N must be between 0 and 255.
  36.         -When n is zero it must be replaced by 256 in speed formula.
  37.         -(-1 is an interrupt vector. Not used here.)
  38.         -According to this information the speed can be varied between
  39.          75 bps (n=0) and 19200 bps (n=1).
  40.  
  41.       Speed change can also be achieved by poking the values direcly into
  42.       their memory locations (in supervisor -mode):
  43.  
  44.         -The control register value $01 (hex) must be poked into memory
  45.          location $FFFA19 (control register of timer A). When control
  46.          register value is $00 (default) the timer doesn't run.
  47.  
  48.         -The divider value ($00 - $FF hex) must be poked into memory
  49.          location $FFFA1F (timer A data register). Look at the 2nd RS-232
  50.          speed achieved -formula, which is 15 rows above.
  51.  
  52.  
  53.  
  54.       CONTROL REGISTER (at $FFFC04) on midi chip 6850 according to Motorola's
  55.       datasheets. There are many unimportant bits described:
  56.  
  57.  
  58.       bit 1    bit 0     description/purpose
  59.       -----    -----     -------------------
  60.         0        0        RX/TX clock rate/1  (don't use, for synchronous only)
  61.         0        1       >RX/TX clock rate/16 (don't care)
  62.         1        0        RX/TX clock rate/64 (don't care)
  63.         1        1        Reset               (don't care)
  64.  
  65.       >) default. The RS-232 speed is changed by timer A. At the beginning
  66.          of this memory map -list there was a description of TIMER A on the
  67.          multi function peripheral 68901. Change the speed from there, not
  68.          here.
  69.  
  70.  
  71.       bit 4    bit 3   bit 2    description/purpose
  72.       -----    -----   -----    -------------------
  73.         0        0       0       7E2 (7 databits, even parity, 2 stopbits)
  74.         0        0       1       7O2 (odd parity)
  75.         0        1       0       7E1 (1 stopbits)
  76.         0        1       1       7O1
  77.         1        0       0       8N2 (8 databits, no parity, 2 stopbits)
  78.         1        0       1      >8N1 (This is the most usual on BBSes)
  79.         1        1       0       8E1 (even parity)
  80.         1        1       1       8O1 (odd parity)
  81.  
  82.       >) default (and mostly used).
  83.  
  84.  
  85.       bit 6    bit 5     description/purpose
  86.       -----    -----     -------------------
  87.         0        0       >DTR  low,  transmitter IRQ off
  88.         0        1        DTR  low,  transmitter IRQ on
  89.         1        0        DTR* high, transmitter IRQ off
  90.         1        1        DTR  low,  transmitter IRQ off. Sends BREAK.
  91.  
  92.       *) When you put DTR high and back low again, the caller will be logged
  93.          off. DTR must be LOW (= default), if you want your modem to answer
  94.          incoming calls. DTR must also be connected to modem to enable auto
  95.          answer.
  96.  
  97.       >) default (auto answer enabled in default position).
  98.  
  99.  
  100.       bit 7     description/purpose
  101.       -----     -------------------
  102.         0        Receiver interrupt disabled (used to silence the port)
  103.         1       >Receiver interrupt enabled.
  104.  
  105.       >) default.
  106.  
  107.  
  108.       The same register can also be read from. When read, it is called
  109.       the STATUS REGISTER (i.e. the memory location is the same as the
  110.       one of the control registers). Again THERE ARE MANY UNIMPORTANT
  111.       BITS described to the interested reader:
  112.  
  113.       bit 0: when RXD register is full, this bit is set. (don't care,
  114.              bios will handle)
  115.  
  116.       bit 1: when TXD register is empty this register is set. (don't care,
  117.              bios will handle this)
  118.  
  119.  
  120.       bit 2: a low -high -transition at DCD sets this input (however, this
  121.              input can't be used, since a low-high transition causes also
  122.              an interrupt and jams ST totally until a character is received 
  123.              via MIDI or 2ND RS port).
  124.              YOU CAN ALSO DETECT THE INCOMING CALLER BY CHECKING THE STATUS
  125.              OF THE RECEIVER BUFFER OF THE MIDI INTERFACE.
  126.  
  127.       bit 3: status of CTS (not used in this circuit, don't care)
  128.  
  129.       bit 4: show frame error. (sets when incorrect amount of stop bits.
  130.              Usually, don't care...)
  131.  
  132.       bit 5: Sets if you forgot to read characters from rx data buffer
  133.              (overrun). (don't care, reading is handled by bios)
  134.  
  135.       bit 6: Sets on parity error. Usually (when word= 8N1) don't care.
  136.  
  137.       bit 7: Sets on interrupt. With a help of this line you can connect N
  138.              SERIAL PORTS to your ST (N>>2). Just place N pieces of 6850's
  139.              into different memory locations and hook them into same interrupt
  140.              line. On IRQ, poll the 6850's through and check whether this bit
  141.              is set. You will have to write a new interrupt driver for this.
  142.              Also, the serial ports should each have a buffer of at least 2k,
  143.              since the ST's processing capasity is pulled to the limits when
  144.              there are many users using one ST. There won't become a circuitry
  145.              for this from me, because I am normally using an Intel ?86 based
  146.              computer, sorry. (For standard users: don't care neither about
  147.              bit #7, nor any other of those seven above.)
  148.  
  149.  
  150.  
  151.       DATA REGISTER (you can read and write this) is at $FFFC06. This
  152.       register contains the received data and when you write into it, you
  153.       "send" data. You must, of course, check, that it's empty before trying
  154.       to send something. Normally you don't need to get involved with this
  155.       memory location, but just in case you want to write a new interrupt
  156.       driver for the second RS-232 interface, so it's there for you.
  157.       Width 8 bits. (Standard sysops/users: don't care about this memory
  158.       location, bios will handle it.)
  159.  
  160.  
  161.                           -     -     -
  162.  
  163.  
  164.  
  165. There is a Multi_User_BBS -software, GURFF_ST done by my brother utilizing
  166. circuitry described here. It will be available in major BBSes after about
  167. 6-12 (?) months of hard (??) programming. Also the C sources of that BBS
  168. will be tried to make available. The programme will be made so small in
  169. size, that there can be 3 USERS ON A STANDARD 1040 ST; also 3 programmes
  170. running simultaneously under MT C -shell (that is UN*X like C shell, a PD
  171. multitasking environment). Also a quick hard disk (faster than the 65ms
  172. SH204 or SH205) is recommended. On a 520 ST three simultaneous users is
  173. a problem. You with a 520 ST should build the 1 MB memory expansion
  174. IMMEDIATELY :-)
  175.       When this document was released (1.1.-89) Noitarumpu_BBS using the
  176. test version of GURFF_ST only had one telephone line, because one costs
  177. about $850 here in Oulu.
  178.  
  179.       However, we can test drive GURFF on three sessions, since we have a test
  180. terminal attached to the second RS -port. You can try to tell the sysop at
  181. Noitarumpu_BBS to hurry the project up a little, as long as you don't tell
  182. him I advised you to do so.    ;-)
  183.       Let's hope, that this software project doesn't prevent you from making
  184. a multiuser software of your own (a real UN*X?). When you have written the
  185. sources yourself, it's much easier to expand the software. If you make it a
  186. Public Domain multitasking system, you can add these documents (as long as
  187. you add the whole archive RS232-2.ARC) with no cost & permission.
  188.  
  189.  
  190.